package cn.tedu.shoot;

import java.awt.image.BufferedImage;

//天空
public class Sky extends FlyingObject{
    private int speed;
    private int y1; //第二张图片的坐标
    public Sky(){
        super(400,900,0,0);
        speed = 1;
        y1 = -700;
    }

    public void step(){
        y += speed;
        y1 += speed;
        if(y>=700){//若y>=窗口的高了，表示移到最下面了
            y = -700;//则将y修改为负的窗口的高，即移到最上面去
        }
        if(y1>=700){
            y1 = -700;
        }
    }

    public BufferedImage getImage() {
        return Images.background;
    }

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    public int getY1() {
        return y1;
    }

    public void setY1(int y1) {
        this.y1 = y1;
    }
}
